#include <stdio.h>
#include "binaryTree.h"
BinaryTree *initTree() {
    TreeNode *nodeA = createTreeNode('A');
    TreeNode *nodeB = createTreeNode('B');
    TreeNode *nodeC = createTreeNode('C');
    TreeNode *nodeD = createTreeNode('D');
    TreeNode *nodeE = createTreeNode('E');
    TreeNode *nodeF = createTreeNode('F');
    TreeNode *nodeG = createTreeNode('G');
    TreeNode *nodeH = createTreeNode('H');
    TreeNode *nodeK = createTreeNode('K');

    BinaryTree *tree = createBinaryTree(nodeA);
    insertBinaryTree(tree, nodeA, nodeB, nodeE);
    insertBinaryTree(tree, nodeB, NULL, nodeC);
    insertBinaryTree(tree, nodeE, NULL, nodeF);
    insertBinaryTree(tree, nodeC, nodeD, NULL);
    insertBinaryTree(tree, nodeF, nodeG, NULL);
    insertBinaryTree(tree, nodeG, nodeH, nodeK);

    return tree;
}

void test01() {
    BinaryTree *tree = initTree();
    printf("tree count: %d\n", tree->count);
    printf("preOrder:");
    preOrderBTree(tree);
    printf("\ninOrder:");
    inOrderBTree(tree);
    printf("\npostOrder:");
    postOrderBTree(tree);
    printf("\nlevelOrder: ");
    levelOrderBTree(tree);
    printf("\npreOrderNoRecur");
    preOrderBTreeNoRecur(tree);
    printf("\ninOrderNoRecur");
    inOrderBTreeNoRecur(tree);

    releaseBinaryTree(tree);
}

int main() {
    test01();
    return 0;
}